import { createStore } from "vuex";
import createPersistedState from 'vuex-persistedstate'
import appConfig from './module/appConfig'
import user from './module/user'

export default createStore({
    state: {},
    mutations: {},
    actions: {},
    modules: {
        appConfig,
        user
    },
    plugins: [createPersistedState({
        storage: window.sessionStorage,
        reducer(val) {
            console.log(val)
            return {
                user: val.user,
                appConfig: {
                    tabsList: val.appConfig.tabsList,
                    cacheViews: val.appConfig.cacheViews,
                }
            }
        }
    })]
});
